package com.leonne.harpacristabrasileira.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.leonne.harpacristabrasileira.R;
import com.leonne.harpacristabrasileira.dao.ConfigurationsDAO;
import com.leonne.harpacristabrasileira.tools.MyConstants;

public class AboutActivity extends Activity{

	private int idAnthem;
	private ConfigurationsDAO dao;
	
	/**
	 * (non-Javadoc)
	 * 
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about);
        Bundle extras = this.getIntent().getExtras();
		this.idAnthem = extras.getInt("IDANTHEM");
		this.dao = new ConfigurationsDAO(this.getBaseContext());
	}
	
	@Override
	public void onUserInteraction (){
		Intent intent;
		MyConstants.ISFAVORITE = false;
		dao.setFirstTimeOpen(0);
		if (idAnthem == -1) {
			intent = new Intent(AboutActivity.this, FirstPageActivity.class);
			intent.putExtra("FORCESEARCH", false);
		} else {
			intent = new Intent(AboutActivity.this, TextContentPageActivity.class);
			intent.putExtra("IDANTHEM", idAnthem);
		}
		startActivity(intent);
		overridePendingTransition(R.anim.fade, R.anim.hold);
	}
	
}
